package com.foryang.springcloud.controller;

import com.foryang.springcloud.entities.CommonResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ResourceController {

    private int i = 0;

    @PreAuthorize("hasAnyAuthority('admin')")
    @GetMapping("/message")
    public CommonResult getMessage(){
        return new CommonResult(200, i++ + "",null);
    }

}
